from sympy import log, sin, cos, sqrt, atan,diff, symbols

x = symbols('x')

functions = [
    log(1 + x**2),      # y = ln(1+x²)
    x**2 * log(x)       # y = x² * ln(x)
]

print("复杂函数的高阶导数:")
for i, func in enumerate(functions, 1):
    print(f"\n函数 {i}: y = {func}")
    
    first_deriv = diff(func, x)
    second_deriv = diff(func, x, 2)
    
    print(f"一阶导数: {first_deriv}")
    print(f"二阶导数: {second_deriv}")
    print(f"化简后的二阶导数: {second_deriv.simplify()}")